<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <button id="btn1">Button1</button>
    <script type="text/javascript">
        var btn1=document.getElementById('btn1');
        btn1.onclick=function(e){
            console.log(e);
        };
    </script>
</body>
</html>